package com.cloudz.iptv.fragment.content.v1.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.cloudz.iptv.App;
import com.cloudz.iptv.R;
import com.cloudz.iptv.fragment.content.v1.adapter.data.ItemImageTextBean;
import com.owen.adapter.CommonRecyclerViewAdapter;
import com.owen.adapter.CommonRecyclerViewHolder;
import com.owen.adapter.CommonViewHolder;

public class ImageTextAdapter extends CommonRecyclerViewAdapter
{


    public ImageTextAdapter(Context context)
    {
        super(context);
    }

    @Override
    public int getItemLayoutId(int viewType)
    {
        return R.layout.item_grid_text_image_layout;
    }

    @Override
    public void onBindItemHolder(CommonRecyclerViewHolder helper, Object item, int position)
    {
        ItemImageTextBean itemBean = (ItemImageTextBean) item;

        CommonViewHolder holder = helper.getHolder();
        holder.setText(R.id.title, (position + 1) + "");
//        holder.setImageResource(R.id.imgview, itemBean.imgUrl);

        //showImage(helper, R.id.footer_menus_img, item.);
        ImageView imageView = helper.getHolder().getView(R.id.image);

        Glide.with(App.get()).load(itemBean.imgUrl).into(imageView);

    }
}
